home *** CD-ROM | disk | FTP | other *** search
/ DIM Series: Yumi Fukawa / DIM Series: Yumi Fukawa.iso / pc / data / photo_l.dxr / 00007_TDDAlbumThumbnail.ls < prev    next >
Encoding:
Text File  |  1998-06-10  |  7.0 KB  |  218 lines

  1. property fid, fcandrag, fcandrop, fdragviewsprnum, fhidewhiledrag, forgloc, fdragtargets, flastrolloversprnum, flastrolloversprkind
  2. global kalbumeditorthumbnailsprnumbgn, kalbumeditorinsertareasprnumbgn, knummaxalbumphotos, kalbumeditordragviewsprnum, kalbumeditorinsertmarkersprnum, kalbumeditordeletebtnsprnum, galbumphotoorder
  3.  
  4. on beginSprite me
  5.   set fid to symbol(fid)
  6.   set forgloc to the loc of sprite the spriteNum of me
  7.   set ftracking to 0
  8.   set fdragtargets to []
  9.   set flastrolloversprnum to 0
  10.   set flastrolloversprkind to #thumbnail
  11. end
  12.  
  13. on mouseEnter me
  14.   if (the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) > count(galbumphotoorder) then
  15.     exit
  16.   end if
  17.   setcurs(member "openHandCurs", member "openHandCursMask")
  18. end
  19.  
  20. on mouseLeave me
  21.   resetcurs()
  22. end
  23.  
  24. on mouseDown me
  25.   setcurs(member "closeHandCurs", member "closeHandCursMask")
  26.   if (the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1) > count(galbumphotoorder) then
  27.     exit
  28.   end if
  29.   repeat with asprcount = 1 to 120
  30.     if sendSprite(asprcount, #mddmatchgroup, fid) = 1 then
  31.       add(fdragtargets, asprcount)
  32.     end if
  33.   end repeat
  34.   deleteAt(fdragtargets, getPos(fdragtargets, the spriteNum of me))
  35.   sendSprite(kalbumeditordragviewsprnum, #msetphotonum, getAt(galbumphotoorder, the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1))
  36.   sendSprite(kalbumeditordragviewsprnum, #mupdatethumbnailview)
  37.   setcurphotonumnoupdate(the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1)
  38.   mtrackmouse(me)
  39.   resetcurs()
  40.   updatephotoview()
  41. end
  42.  
  43. on mtrackmouse me
  44.   if fhidewhiledrag then
  45.     mhideself(me)
  46.   end if
  47.   repeat while the stillDown
  48.     set the loc of sprite fdragviewsprnum to point(the mouseH, the mouseV)
  49.     set arolloversprnum to mgetrolloversprnum(me)
  50.     if flastrolloversprnum <> arolloversprnum then
  51.       mresetrolloverhilite(me)
  52.       set flastrolloversprnum to arolloversprnum
  53.       msetrolloverhilite(me)
  54.     end if
  55.     updateStage()
  56.   end repeat
  57.   if flastrolloversprnum > 0 then
  58.     mdodrop(me)
  59.   end if
  60.   set the loc of sprite fdragviewsprnum to point(-1000, -1000)
  61.   mresetrolloverhilite(me)
  62.   mshowself(me)
  63.   mhidedragviewspr(me)
  64. end
  65.  
  66. on mddmatchgroup me, vid
  67.   return fid = vid
  68. end
  69.  
  70. on mgetrolloversprnum me
  71.   set aminlength to 65535
  72.   set anearsprnum to 0
  73.   set anumdragtargets to count(fdragtargets)
  74.   repeat with adragtargetscount = 1 to anumdragtargets
  75.     set atargetsprnum to getAt(fdragtargets, adragtargetscount)
  76.     if ptinrect(point(the mouseH, the mouseV), the rect of sprite atargetsprnum) then
  77.       set alengthh to the locH of sprite atargetsprnum - the mouseH
  78.       set alengthv to the locV of sprite atargetsprnum - the mouseV
  79.       set alength to sqrt((alengthh * alengthh) - (alengthv * alengthv))
  80.       if alength < aminlength then
  81.         set aminlength to alength
  82.         set anearsprnum to atargetsprnum
  83.       end if
  84.     end if
  85.   end repeat
  86.   return anearsprnum
  87. end
  88.  
  89. on mresetrolloverhilite me
  90.   case flastrolloversprkind of
  91.     #clearbtns:
  92.       set the ink of sprite flastrolloversprnum to 8
  93.     #thumbnail:
  94.       set the ink of sprite flastrolloversprnum to 0
  95.     #insertarea:
  96.       sendSprite(kalbumeditorinsertmarkersprnum, #mhidemarker)
  97.   end case
  98. end
  99.  
  100. on msetrolloverhilite me
  101.   if flastrolloversprnum = kalbumeditordeletebtnsprnum then
  102.     set the ink of sprite flastrolloversprnum to 2
  103.     set flastrolloversprkind to #clearbtns
  104.   else
  105.     if (flastrolloversprnum - kalbumeditorthumbnailsprnumbgn + 1) <= count(galbumphotoorder) then
  106.       mresetrolloverhilite(me)
  107.       set the ink of sprite flastrolloversprnum to 2
  108.       set flastrolloversprkind to #thumbnail
  109.     else
  110.       if (kalbumeditorinsertareasprnumbgn <= flastrolloversprnum) and (flastrolloversprnum <= (kalbumeditorinsertareasprnumbgn + knummaxalbumphotos + 5)) then
  111.         if mgetinsertareanum(me, flastrolloversprnum) <= count(galbumphotoorder) then
  112.           mresetrolloverhilite(me)
  113.           sendSprite(kalbumeditorinsertmarkersprnum, #msettargetsprnum, flastrolloversprnum)
  114.           sendSprite(kalbumeditorinsertmarkersprnum, #mshowmarker)
  115.           set flastrolloversprkind to #insertarea
  116.         else
  117.           msetrolloverhilitelastinsertpoint(me)
  118.         end if
  119.       else
  120.         msetrolloverhilitelastinsertpoint(me)
  121.       end if
  122.     end if
  123.   end if
  124. end
  125.  
  126. on msetrolloverhilitelastinsertpoint me
  127.   mresetrolloverhilite(me)
  128.   sendSprite(kalbumeditorinsertmarkersprnum, #msettargetsprnum, mgetinsertareasprnum(me, count(galbumphotoorder)))
  129.   sendSprite(kalbumeditorinsertmarkersprnum, #mshowmarker)
  130.   set flastrolloversprkind to #insertarea
  131. end
  132.  
  133. on mdodrop me
  134.   if flastrolloversprnum = kalbumeditordeletebtnsprnum then
  135.     deletealbumphotoorder(the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1)
  136.   else
  137.     if flastrolloversprnum >= kalbumeditorinsertareasprnumbgn then
  138.       insertalbumphotoorder(mgetinsertareanum(me, flastrolloversprnum), the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1)
  139.     else
  140.       swapalbumphotoorder(flastrolloversprnum - kalbumeditorthumbnailsprnumbgn + 1, the spriteNum of me - kalbumeditorthumbnailsprnumbgn + 1)
  141.     end if
  142.   end if
  143. end
  144.  
  145. on mhideself me
  146.   set the loc of sprite the spriteNum of me to point(-1000, -1000)
  147. end
  148.  
  149. on mshowself me
  150.   set the loc of sprite the spriteNum of me to forgloc
  151. end
  152.  
  153. on mhidedragviewspr me
  154.   set the loc of sprite fdragviewsprnum to point(-1000, -1000)
  155. end
  156.  
  157. on mgetinsertareanum me, vsprnum
  158.   set aareanum to vsprnum - kalbumeditorinsertareasprnumbgn + 1
  159.   if aareanum > 8 then
  160.     set aareanum to aareanum - 1
  161.   end if
  162.   if aareanum > 14 then
  163.     set aareanum to aareanum - 1
  164.   end if
  165.   if aareanum > 20 then
  166.     set aareanum to aareanum - 1
  167.   end if
  168.   if aareanum > 27 then
  169.     set aareanum to aareanum - 1
  170.   end if
  171.   if aareanum > 33 then
  172.     set aareanum to aareanum - 1
  173.   end if
  174.   if aareanum = 40 then
  175.     if count(galbumphotoorder) = knummaxalbumphotos then
  176.       set aareanum to 1
  177.     end if
  178.   end if
  179.   return aareanum
  180. end
  181.  
  182. on mgetinsertareasprnum me, vinsertareanum
  183.   set asprnum to kalbumeditorinsertareasprnumbgn + vinsertareanum
  184.   if vinsertareanum > 8 then
  185.     set asprnum to asprnum + 1
  186.   end if
  187.   if vinsertareanum > 14 then
  188.     set asprnum to asprnum + 1
  189.   end if
  190.   if vinsertareanum > 20 then
  191.     set asprnum to asprnum + 1
  192.   end if
  193.   if vinsertareanum > 27 then
  194.     set asprnum to asprnum + 1
  195.   end if
  196.   if vinsertareanum > 33 then
  197.     set asprnum to asprnum + 1
  198.   end if
  199.   if vinsertareanum > 40 then
  200.     set asprnum to asprnum + 1
  201.   end if
  202.   return asprnum
  203. end
  204.  
  205. on getPropertyDescriptionList
  206.   set adesc to [:]
  207.   addProp(adesc, #fid, [#default: "group1", #format: #string, #comment: "ID"])
  208.   addProp(adesc, #fcandrag, [#default: 0, #format: #boolean, #comment: "can drag"])
  209.   addProp(adesc, #fcandrop, [#default: 0, #format: #boolean, #comment: "can drop"])
  210.   addProp(adesc, #fdragviewsprnum, [#default: 0, #format: #integer, #comment: "drag view spr num"])
  211.   addProp(adesc, #fhidewhiledrag, [#default: 1, #format: #boolean, #comment: "hide while drag"])
  212.   return adesc
  213. end
  214.  
  215. on getBehaviorDescription
  216.   return "テ‡ツアテ‡テε厩テ丑テ嘉、テ益テ曳テ‡ツ敕「cテウテイテアナセテャIテ‡ツシテゥgテウpテ‡ツオテ‡ツサテ‡ツ「テ‡ツシテ‡テ\テ③" & RETURN & RETURN & "script by TOBE Hitoshi" & RETURN & "email : to@be.to"
  217. end
  218.